package com.liupaik.pennmarketplace;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class Intro extends Activity {

	 /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.intro);
        
        Button toLogin = (Button) findViewById(R.id.tologin_button);
        toLogin.setOnClickListener(new OnClickListener() {
        	public void onClick(View view) {
        		Intent myIntent = new Intent(view.getContext(), LogIn.class);
        		startActivityForResult(myIntent, 0);
        	}
        });
        
        Button toRegister = (Button) findViewById(R.id.toregister_button);
        toRegister.setOnClickListener(new OnClickListener() {
        	public void onClick(View view) {
        		Intent myIntent = new Intent(view.getContext(), Register.class);
        		startActivityForResult(myIntent, 0);
        	}
        });
        
    }
    
    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if (keyCode == KeyEvent.KEYCODE_BACK) {
            moveTaskToBack(true);
            return true;
        }
        return super.onKeyDown(keyCode, event);
    }
    
}
